package IO;

import java.io.*;
import java.util.Scanner;

public class IODemo12 {
    public static void main(String[] args) throws IOException {
        //InputStream类创建的对象的其他用法——用作Scanner的参数
        InputStream inputStream = new FileInputStream("./test.txt");
        Scanner scanner = new Scanner(inputStream);
        //String line = scanner.nextLine();
        //System.out.println(line);


        while(scanner.hasNext()){
            System.out.println(scanner.next());
        }
        inputStream.close();
    }
}
